package com.jdd.feign;

import com.jdd.common.constant.Send;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("passage-mqtt")
public interface MqttFegin {
    /**
     * 向mqtt中间件发送消息，不带topic
     *
     * @param data Send实体
     * @return java.lang.String
     * @throws
     * @author zxl
     * @date 2022/10/27 14:20
     */
    @PostMapping(value = "/send")
    String sendMessage(@RequestBody Send data);

    /**
     * 向mqtt中间件发送消息，带topic
     *
     * @param data Send实体
     * @return java.lang.String
     * @throws
     * @author zxl
     * @date 2022/10/27 14:20
     */
    @PostMapping(value = "/send/topic")
    String sendMessageWithTopic(@RequestBody Send data);

    /**
     * 向mqtt中间件发送消息，带topic和qos
     *
     * @param data Send实体
     * @param qos  质量类型
     * @return java.lang.String
     * @throws
     * @author zxl
     * @date 2022/10/27 14:21
     */
    @PostMapping(value = "/send/qosandtopic")
    String sendMessageWithTopicAndQos(@RequestBody Send data, @RequestParam("qos") int qos);

}
